package han.yang.service.user.controller;

import han.yang.common.ResponseVO;
import han.yang.service.user.model.req.ImportUserReq;
import han.yang.service.user.service.ImUserService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.constraints.NotNull;

/**
 * @author yanghan
 * @date 2023/2/15
 */
@RestController
@RequestMapping("v1/user")
public class ImUserController {

    @Resource
    ImUserService imUserService;

    @RequestMapping("/importUser/{appId}")
    public ResponseVO impoerUser(@NotNull @RequestBody ImportUserReq req,
                                 @PathVariable("appId") Integer appId){
        req.setAppId(appId);
        return imUserService.importUser(req);
    }

}
